package br.com.appcalipse.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.dao.BaseDAO;
import br.com.appcalipse.domain.Anuncio;

/**
 * DAO de {@link Anuncio}.
 * 
 * @author finx
 * @created Apr 25, 2013
 */
public class AnuncioDAO extends BaseDAO<Anuncio> {

	public List<Anuncio> findByCarro(String carro) {
		Criteria criteria = createCriteria();
		if (carro != null)  {
			criteria.add(Restrictions.eq("carro", carro));
		}
		return executeQuery(criteria);
	}
	
}
